package org.jeecg.common.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.common.entity.HsPerson;
import org.jeecg.common.mapper.HsPersonMapper;
import org.jeecg.common.service.IHsPersonService;
import org.jeecg.common.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * @Description: hs_person
 * @Author: 国子软件
 * @Date: 2025-05-06
 * @Version: V1.0
 */
@Service
@Slf4j
public class HsPersonServiceImpl extends ServiceImpl<HsPersonMapper, HsPerson> implements IHsPersonService {
    @Resource
    private HsPersonMapper hsPersonMapper;
    @Override
    public Page<HsPerson> queryPage(String name, Page<HsPerson> page){
        LambdaQueryWrapper<HsPerson> wrapper = new LambdaQueryWrapper<>();
        if(StringUtils.isNotEmpty(name)){
            wrapper.like(HsPerson::getName, name);
        }

        return hsPersonMapper.selectPage(page,wrapper);
    }
}
